class Send {
  static success(data, message = "success") {
    return { code: 0, message, data };
  }

  static fail(message, code = 400) {
    if (!message) return { message: "fail", code };
    if (typeof message === "string") return { code, message };
    if (message.code !== undefined) return message;
    return { code, message: String(message) };
  }
}

module.exports = Send;
